package com.example.administrator.waitan.find.life.LifeContentActivity;

import android.app.Notification;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.example.administrator.waitan.R;

/**
 * Created by Administrator on 2016/1/20.
 */
public class DownLoadBroadcast extends BroadcastReceiver {
    private Context context;
    @Override
    public void onReceive(Context context, Intent intent) {
        NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
        Notification.Builder builder = new Notification.Builder(context);
        builder.setSmallIcon(R.mipmap.mi_icon);
        builder.setContentTitle("外滩图片已下载");
        builder.setContentText("外滩life图片已经下载完毕");
        builder.setWhen(System.currentTimeMillis());
        builder.setNumber(1);
        Notification notification = builder.build();
        notification.flags = Notification.FLAG_AUTO_CANCEL;
        manager.notify(0,notification);
    }
}
